using System.Text.RegularExpressions;

namespace Andshev.OrmTools.Linq2Query.Extensions
{
    public static class StringExtensions
    {
        public static string FormatWith(this string format, params object[] parameters)
        {
            return string.Format(format, parameters);
        }

        public static string CleanBrackets(this string str)
        {
            return str
                .Replace("(", string.Empty)
                .Replace(")", string.Empty)
                .Replace("{", string.Empty)
                .Replace("}", string.Empty);
        }

        public static string ChangeQuotes(this string str)
        {
            return str
                .Replace("\"", "\'"); // TODO
        }

        public static string RegexReplace(this string str, string pattern, string replacement)
        {
            return Regex.Replace(str, pattern, replacement);
        }
    }
}